package day6;

import java.util.Calendar;
import java.util.Date;

/**
 * @author oldliu
 * @since 1.0
 */
public class CalTest2 {
    public static void main(String[] args) {
        Calendar cal = Calendar.getInstance();
        cal.set(Calendar.YEAR,2020);
        cal.set(Calendar.DAY_OF_MONTH,1);//!!!
        cal.set(Calendar.MONTH,1);//2月份。。。
        System.out.println(cal.getTime());
//        cal.set(Calendar.DAY_OF_MONTH,40);
//        System.out.println(cal.getTime());
//        cal.set(2022,Calendar.FEBRUARY,30,8,40);
//        System.out.println(cal.getTime());
        int days = cal.getActualMaximum(Calendar.DAY_OF_YEAR);
        System.out.println(days);

        int days2 = cal.getActualMaximum(Calendar.DAY_OF_MONTH);
        System.out.println(days2);

        cal.setTime(new Date());
        System.out.println(cal);
    }
}
